// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
// css
import 'normalize.css'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/base.less'
// import 'babel-polyfill' // 兼容低版本浏览器
import 'es6-promise' // 兼容低版本浏览器
import Vue from 'vue'
import ElementUI from 'element-ui'
import VueProgressBar from 'vue-progressbar'
import axios from 'axios'
import $ from 'jquery'
import _ from 'lodash'

// vue滑块
// import VueAwesomeSwiper from 'vue-awesome-swiper'

// 本地组件
// import Theme from './assets/lib/echart-themes'
import store from './store'
import App from './App'
import router from './router'
// import api from './api'

// 监控
import './monitor/index'

// API 组件 test
// Vue.use(VueAwesomeSwiper)
Vue.use(ElementUI, {size: 'medium'})
Vue.use(VueProgressBar, {
  color: '#409EFF',
  failedColor: 'red',
  height: '2px'
})

// vue filter
import './filters/index'

// 注册 echarts 主题
// ECharts.registerTheme('macarons', Theme)
// let _Echarts = {}
// _Echarts.init = ECharts.init
// ECharts.init = function (dom, theme, opts) {
//   return _Echarts.init.call(null, dom, (theme || 'macarons'), opts)
// }

// jquery lodash
window.jQuery = window.$ = $
window._ = _

Vue.config.productionTip = false
Vue.prototype.$http = axios

// 全局加载进度条
// PACE loading
// require('./assets/lib/PACE/themes/green/pace-theme-minimal.css')
// require('./assets/lib/PACE/pace.min.js')
// router.beforeEach((to, from, next) => {
//   /* globals Pace */ // eslint 忽略
//   Pace.restart()
//   next()
// })

export default new Vue({
  el: '#app',
  store,
  router,
  template: '<App/>',
  components: {App}
})
